import request from '@/utils/request'
import { getToken } from '@/utils/auth'
export function login(username, password) {
  return request({
    url: '/userAuth/getAdminToken',
    method: 'post',
    data: {
      username,
      password,
      apiId:'ADMINWEB',
    }
  })
}

export function getInfo() {
  return request({
    url:'/admin/info',
    method: 'get',
  })
}

//发送验证码
export function sendLoginSMSCode(data) {
  return request({
    url:'/userAuth/sendLoginSMSCode',
    method: 'post',
    data
  })
}

//发送找回密码验证码
export function sendFindPasswordSMSCode(data) {
  return request({
    url:'/userAuth/sendFindPasswordSMSCode',
    method: 'post',
    data
  })
}

//手机验证码登录
export function smsCodeLogin(mobile,smsCode) {
  return request({
    url:'/userAuth/smsCodeLogin',
    method: 'post',
    data: {
      mobile,
      smsCode,
      apiId:'ADMINWEB',
    }
  })
}

//忘记密码
export function smsFindPassword(mobile,smsCode,password) {
  return request({
    url:'/userAuth/smsFindPassword',
    method: 'post',
    data: {
      mobile,
      smsCode,
      password,
      apiId:'ADMINWEB',
    }
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}
